import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import postcsspxtorem from 'postcss-pxtorem'
import basicSsl from '@vitejs/plugin-basic-ssl'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react(), basicSsl()],
  server: {
    host: true,
    https: true,
    proxy: {
      '/socket.io': {
        target: 'https://127.0.0.1:3000',
        ws: true,
        changeOrigin: true,
        secure: false,
      },
    }
  },
  css: {
    postcss: {
      plugins: [
        postcsspxtorem({
          rootValue: 37.5,
          propList: ['*'],
          selectorBlackList: ['.norem'],
          exclude: /node_modules/i,
          minPixelValue: 2
        })
      ]
    }
  }
})
